Added some optimalization for animation