Rearrange driver code