Refactored categories loading