refactor Mastermind class