Introduce AbstractLookup as a common superclass for many lookups to
reduce code duplication.