Refactor search data code to SearchDataHelper class