Refactoring the registration and start using ng-route