documentation and small cleanups