To me, your version is less readable than the original one. It hides the fact that one branch prints one line but other prints multiple lines (you need to read the strings carefully to realize that in your version). I consider the duplication a small price to pay for this information.