put flags in an enum and remove a couple of unused defines