refactor out the pretty json