refactor so settings are no longer deleted before saving