refactored animationobject