optimise merge.