refactor string prettyprint