Refactor design somewhat