Refactored library GuardedRecursion.