qcdnum: refactor