improved parsing input