extrapolated request enhancement logic to separate file, request.js.