refactor multiminimax