improving controllers and templates 2