cleanups and small improvements