Improve id/email resolution