Refactors search and adds use strict