Refactor of results formatting using auxiliary and object functions.