move config to classes to enable [de]serialisation back and forth to json