Simplify get next id method