add generic functions to core instead of struct with pointers
add generic functions to core instead of struct with pointers