protocol refactor