improvement on string converter factory