some functional angular.js mojo achieved