optimizing kernel by getting rid of some things