restructured plugin protocol internals