move animation into class