some documentation and cleanup