refactoring of control search