moved os-dependant code into per-os files