DRYing up case statements, prettify output