Refactoring max id logic to a common method

Change-Id: I1f649b570ee43d6c0540a207693d2cbee4538fb8
1 file changed