Moved html app code into a template