More cleanup to logging and output