printStats() refactoring