some cleanups and comments