New implementation of replace ID.