Cleaning up and formatting output