refactor animation