cleanups and documentation