refactoring tests for similarity