Refactor the code for better OS auto detection handling