Can't this and the same work done above be put under a function or the save config operation be done aggregated?