Using memory info from mastermind and refactoring