Adding to this answer, John Frederick Hayes signed a "Short Service Attestation" with The Yorkshire Regiment in 1894. In the document, he states that he had previously served with The Middlesex Regiment, having purchased his discharge.
Searching for JFH in 1881 & 1891 has not been totalling revealing, however, I think it likely he was a scholar in St. Agnes Orphanage, Church Road, Leyton in 1881.