code refactored and search feature on