Refactor to separate adaptor and driver files