Pinch some template code from RemoteTSViewing app