Cleanups of data_ptr setting and getting