much improved parsing hooked into handler