refatorando ai_player