Moved angular stuff to services layer