Move flag.Parse to proper place, remove redundant func.