move common methods from drived classes of inference methods to base class