refactoring show loading