Simple dependency injection for functions