Original: In fact they had been doing some work for a local farmer and he had lent the boys the horse to ride home on.
Simplified: They had been doing some work for a local farmer and he had lent the boys the horse to ride home on.