various minor cleanups and improvements