@seanblue Sorry for the wait :)

 I would definitely like the code factored out. The two ways I see it is either the way you proposed or create a 'pre' and 'post' reset function (hopefully with better names). Your way with the optional parameter for the state is probably better and I guess falls in the scope of 'reset'.