refactor design