better search Uri protection + code simplification