lcs diff optimization; tests refactoring