Write advanced template