Refactor settings, fix deps