Extracted HTML creation code, refactored all calls. Added array of NAGs