move animation logic into separate file