refactoring loading