refactored to using ui-router