remove unneeded blocks