Refactored angular to work with minification