Improved enum usage and validation.