Make scans order independent & refactoring