Create input handlers file
Refactor and reorganize