Refactored to Angular service
Added minified version