clean up code, log messages, and comments.