Isolated code for loading animations