More refactoring to use input class