Refactoring common code for when the phase-difference is the same.
Refactoring common code for when the phase-difference is the same.

cogumbreiro/hj-coq,cogumbreiro/habanero-coq,cogumbreiro/habanero-coq,cogumbreiro/habanero-coq