PrinterMain: refactoring in preparation for bed probing support