more kernel refactoring