Added common resource-loading functionality