small refactoring of CMDFRAMELENGTH as far a possible