Broke input parsing into separate method