optimizations to header animation