added unique ptr for resources