Generation of moment matrices unified