phpdoc and supress PHPMD warning for necessary exit
try to reduce complexity