Code optimization

deleted some unneeded code.