Extracted existing preprocessing calls into the new function.