Refactored code and added dialogue search module.