optimization and fix doc