various cleanups and streamlining