lookup implementation non-DRY