private Observer createObserver() {
        return new Observer() {
            @Override
            public void update(final String event) {
                switch (event) {
                    case "Opened":
                        int count = cell.countNeighborsWithMines();
                        refresh((count == 0) ? "" : Integer.toString(count));
                        break;
                    case "Marked":
                        marked = true;
                        notifyObservers("marked");
                        break;
                    case "errorMarked":
                        notifyObservers("errorMarked");
                        break;
                    case "Locked":
                        notifyObservers("*");
                        break;
                    case "Exploded":
                        notifyObservers("**");
                        Action act = factory.createAction("GameOver");
                        if (act != null) act.execute();
                        break;
                    default:
                        restart();
                }
            }
        };
    }