documentation and cleanup