Refactor protocols