Refactor into a more re-usable state.