refactoring - extracted a few new classes out of Scanner