cleanup

A few more cleanups and a couple of new features.