Convert the Runner class into a function