converting more code to use ui-router