clean up main. delete useless code.
more clean up in main