1. The remote procedure call specific parts could be made more abstract and put into a generally useful package. 2. The code-generation could be done in a seperate package and use that package as a library to provide different APIs to plugin authors. 3. With regard to 2. implement an example library.