Refactored out the row formatter to simplify the summarize method for CodeClimate.