Beautify splitFootnotes function