Refactor the settings lugin