move escaping functions to helpers lib