Convert model in templatehelper to json earlier for better performance