refacor --mode check preparing for some improvements