Code improvements in main.go and root.go