Driver: Factor duplicated code.