loading classes refactored