duplicate code in keymap tool initialization