rpearce: Performance enhancement, to prevent multiple lookups of the
same environment and all its children