Source code refactoring. Extracted common functionality into merged methods

Source code refactoring. Extracted common functionality into merged methods
Function names should be in CamelCase. That is, "PrintService" instead of "printService".