switch to use builtin bitflags!