Refactoring kernel generation to use more compile-time params.