Simplify Ai logic