can you split this function into different ones ? maybe one per os.
For readability purposes.