adding a helper class to keep the code tidy and clean. removed unnecesairy code in the new AI class