Refactoring down animation logic to remove duplication.