refactoring how roles are implemented