remove useless repeatition codes