made conversion from value to string more generic