Refactored, proper determination of settings file.