Moving processing logic from CLI to Scanner class.