search mechanism - refactor