Some tidying up
Split up handleParseResult