cleaning up some controllers and javascript