Refactoerd Game Logic