Refactor the Roles and Resources classes