resolve Paul's comments and clean up some stuffs