We lifted these functions out of the run function.