Refactored IntermediaryResultHandler and added LoggingIntermediaryResultHandler