moved all formatting code to a ValueFormatter class.