refactored non-angularjs globals