splitting id-check in different cases