removing unused mid function