rewrite some default mode algorithm