continuing to refractor this mess