refact main.go