Improved animation class