Refactoring and testing of the common role