simplify animation logic