cleaning controller code