restructured initial equality checks for identity