cleaned up Kernel::generateCommon