Replace InputParser class with function parse_input()