don't repeat some code in HS Analyser
fix some bugs I introduced