Heterogeneity of allocation promotes cooperation in public goods games