Modify platform specific code to be platform agnostic