Refactor lookup. Maybe revert again as complex