Extract the code which builds the implication term into a separate function.