more sophisticated parsing