refactored all angular stuff to help with minification