minor cleanups and improvments