Moved the UIDriver code out