IMPROVED : Advanced string replace in setValue for Template