refactor on search box