Use merge module in place of builting merge function