template and nested