refactor kernel methods