add pairFinder and refactoring