add config.go
refactoring