improved API and doc