modularize AngularJS usage