Removed ugly macro
Encapsulated kernel generation into a class