refactor: the way of processing input