refactor view search