optimization made some code unnecesary