Modified to use simpler parsing structure.