cleaning up logging and formatting