Refined sample code to reflect proper resource storage / manipulation paradigms based on internal feedback