Cleanup controller code