add lazy key handling helper functions