separate key_status & keys gathering
prune key statuses right after they were used
work on ranges whenever it is possible