reading new input pattern, refactor