cleanup (make handler 600loc lighter)