improved parsing