refactor, simplify the settings, improve doc