Added dependency injection for Ai