refactor kmpe