refactored search engine application to work with asynchronous connections