doco and cleanup