Bug fix

Bug: Search results and latest data getting mixed up
Some Refactoring