Refactor some keyevent handlers