Removing useless codes