Make resource class more generic