refactoring printMeth