refactored gameplay