updated formatter to be more extensible