Partly refactored settings file

NOT WORKING