Reduced code complexity of id generator