refactoring and todos