moved code to create restart message to separate function