lookup_or_generate