use stub_const
simplify logic