Re-factor parserutils and code review changes in parserutils_inputstream