DRY up lookup by name/id