Make generateView use writeTemplate helper