core: redone 'if' structure checking