Minor refactor of ToString implementation