refactor key-handler to use core-match