Make basic OS detection more elegant