some cleanups and fixups