use enum to represent flags and fail if flags are not respected