Factor out some partials and add a couple tests