doc and cleanup