Factorize strings in tables