Code cleanup and respond to review comments.