cleaned up addition of encodeUriQuery and removed unused addition of encodeUriSegment