Refactors loading mechanism