a few code cleanups