Separated settings file and some fixes