Changes and refactorings to the animation engine