Refactoring, preparing for keybindings.