refactor, improve design