Implemented the minder search functionality, cleaned the code