Refactor config_secn and config-wan for all devices