Refactoring to a new solution with wrappers and rpcdispatcher.