Clean up kernel specific functions