detector: Clean up code.