Rework Kernel and Event Handling