refactored codebase to use ui-router