Code cleanup and comments.