Refactor arrays into hashes and adjust corresponding print method