mapping external to internal ids