refactoring design and todos