Refactor full scanning.