Improved search.coffee code