Split out UI code, start templating hagard UI