small improvements to docs and code