refactor animate