Way too many arguments to this function... and then you immediately build an object called (wait for it) `args` ;-)

Should refactor to take an object argument that the caller builds some of, then this function augments/transforms.