clean up and completed the controllers