First pass at separating out the platform-specific stuff