sweep.cpp: Cleaning code a little bit