Restructured code for working with new anim