isolate code that check agreement

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>