Separated the platform-specific stuff.