optimization made some code unnecessary