Refactor raw resource loading.