can we replace this by keys.length or something ?