1, add settings file, adjust code structure