template and model improvements