clean up all controller code