add renderTemplate and afterModel