Improving the calcualtion of search filter in home