refactor OOP hangman