Generates instance ids