made merge protocol more generic