refactored game click logic to a more compositional style