more cleanups and hacks