Move input logic to ui
More seperation for UI
Refactoring
More refactoring