sweeper refactored