can we move these printlns into a separate method