scan helper method refactoring