filter keys and remove keys