Improved parsing method.