refactored to more dynamic data handling into the controller code, and use animation event to handle removing animation classes