code cleanups and notes