config.go refactored