refactor search functional test