optimized keys, values, and pluck
(cherry picked from commit 9b1da9b2581ecfe549abeb443f81e4feca76bbbc)