Use dependency injection to inject platform-specific classes