[PATCH v9] pasta: Refactor pasta_ns_conf() to reduce nesting