improved search method, dropped support for ruby1.8