minor tweaks to the parsing logic