Reworked resource loading.