and remove useless code