refactor some os-specific features