re-organizing functions that run kernels to make them cleaner and all independent