More concise flag checking