remove useless and rebuild