Breakdown HTML Writer to head and body parts and more cyclomatic complexity reductions