move initialization code to angular.module().run