refactored random loading message animation to its own method