Removed debug function from NextSearch

... and organized and removed unused usings.