One thing to consider is the fact that that particular course of action might not be correct in all cases. Note the completely proper and desired usage of "that that" in the previous sentence. But then you're getting into grammar checking, and that's probably beyond the scope of your class.
For example :-
Had had had "had had", had Had had had "had" Had would have been corre
+ct.
The above was a comment about the grammar of an essay
written by an author named Had.
My memory concerns me - but I forget why !!!