preliminary work for opponent, refactoring