mtecs: improve logic readability