protocol refactoring