The string melting version of a multi-phase transport model is often applied to high-energy heavy-ion collisions since the dense matter thus formed is expected to be in parton degrees of freedom. In this work we improve its quark coalescence component, which describes the hadronization of the partonic matter to a hadronic matter. We removed the previous constraint that forced the numbers of mesons, baryons, and antibaryons in an event to be separately conserved through the quark coalescence process. A quark now could form either a meson or a baryon depending on the distance to its coalescence partner(s). We then compare results from the improved model with the experimental data on hadron $dN/dy$, $p_{_{rm T}}$ spectra, and $v_2$ in heavy-ion collisions from $sqrt{s_{_{rm NN}}}=62.4$ GeV to $5.02$ TeV. We show that, besides being able to describe these observables for low-$p_{_{rm T}}$ pions and kaons, the improved model also better describes the low-$p_{_{rm T}}$ baryon observables in general, especially the baryon $p_{_{rm T}}$ spectra and antibaryon-to-baryon ratios for multistrange baryons.