Merged getWhere and getFavWhere into one function.