Convert to use classes and split HTML into a vew, plus minor fixes