use flag instead of enum