refactor and get ready for offline compressing

I could, but I'm accessing the config values with dot notation which is not supported in dict type.