Abstract id checking into private helper function