Refactor kernel.runtime.