wip: converting to AngularJS