refactored data output to go through a single function so that formatting is standardized, and to prep for future expansion on output formats