clean up kernel and use correct names of helper functions