begin porting to angular.js