Minesweeper class code refactoring