change angularjs controller structure