some cleanup, comments, and logs