Cleaning up, adding OSX specifics or applicable Linux code