extract merge lines code into separate file