removing unneeded elements