refactored some duplicate code for displaying list of members of a role