Remove useless intermediate code.