Settings refactoring (WIP)