Refactor of overwriting settings logic