Fix comments and re-org code.