How do you handle using Appium to test both an iOS and an Android device with the same C# code?

I notice they both have different drivers (at least for c# that I am using).

private AppiumDriver<AndroidElement> _driver;
private IOSDriver<IOSElement> _iosDriver;  

How do you handle all the different locators etc. Do you write two versions of the code, one for iOS and the other for Android.

Would appreciate any advice you can offer. Thanks