Correct passed type argument and remove redundant code for converting template to string