implove performance
move some doctest to unittest