Some improvements, removed `allowed_values` from `rule`, will be
added to another template.