Define toString template before using toString calls