refactored to use UI-Router states instead of ng-switch in main view