reduce useless codes