Changed resource storage to be more general