stats output formatter refactored