Some refactoring allowing for getting animation state and stepping animations.