Moving out OS specific code into its own file.