Clean code and delete kernel.h

TODO
- add more unit test