Clean up some code and comments and align.