allow option to collect all keys found or just the ones specified