string cleanup func
string cleanup func
improving generic matching logic