Refactored kernel module