refactoring scan and scroll search