more cleanups and documentation