moved implementation of lookups from older code-base