remove some boxing and improve a doc string