Dependency injection for global functions.