Refactored animation slightly to allow for extensibility and reactive events