remove useless code and more