Added IdFactory class.