add generic methods to write config objects, format values and clean strings