refactoring, improved game over input handling