Optimization js of search space navigation