sanitize string and remove repeated get_csv methods