animation engine small refactoring