abstacted animation logic