Restructure grammar for consistency