reimplementing with angular-ui-router