another round of adding the appdelegate refs to the templates.