Some conversion to bitflags and utilities for doing so