cleans up variable to hash conversion
Merge pull request #2187 from opf/feature/nested_config_with_to_hash

cleans up variable to hash conversion