[Refactoring] Decompose duplicate code fragments into  isUserExist.