clean up little bit and use gflags and glog