refactor anim using transition