If you receive different parameters in the different situations, you can certainly load different modules, or dispatch calls to different methods. However, it sounds to me like you used inheritance when you shouldn't have. Maybe instead of this RPC superclass, what you need is a class that implements the actual functionality in a way that's independent of location, and then some other classes that act as wrappers around it and translate as necessary for RPC, local, etc.