Refactor protocol