better switch in parser