Restructured some of the controllers and services in angular