documentation and further cleanup