Refactor and update ngAnimate usage