Restructured to support a formatter function for more flexibility /cc @jbeemster