Improved class design for AI module