more cleanups and fixes