Protocol implementation + unit tests for it