add: getRef function to retrieve terms, better loop fragment parser (without indexOf)