Refactoring platforms and ifdefs