move generator.go out