Refactor start/reset code a bit.