Enhance the grammar-specific settings code