Refactor to move this specific functionality inside OS specific implementation.