The rebooting functionality should be split out into a separate function. But, I have a hard time believing both of these aren't implemented elsewhere. If so, we should consolidate stuff like this rather than duplicating it.