Following jsep practice, it's possible to organize recursive parser - that's better fit for switching parts and can be faster.