extract complicated check in a explicitely named function