redesign and refactor