refactor keyboard mappings