refactoring but something broke