rebased + cosmetic mod for xml settings