Refactoring the resource loading - allow to be more flexible