revamp doc generation