added some note finding utils in order to tidy up removeEmptyNodes