Refactors animator as a component.