Refactor and working on input reader