refactored result formatting
added more support for custom formatters