Refactored category/resource code to remove id's and ensure DRY code