refactor
simple ai