From #182. I don't know what needs to be refactored. @gsnedders would need to provide more guidance as to what needs to be done here.