resolve mainTemplate