Refactored animation module.