moved validate_template into private section.