this was a direct copy of the exiting formatter logic ;)