small fix and remove unneeded variables