added resource management and updated all resources to use the new system