Simplify loading animation code