simplify applyVariant by using "pointer" arithmetic with iterators,
and add new runtime flags.