Define templates once and use them both on client and server - fixing #4