simplify _encodeQS(), minor syntax mods