role factory example