documentation and minor cleanup