remove unneeded locals