remove useless code and fix some warning message.