[PrinterDriver] Cleaned up the code, removed duplicated code and made some methods private.