Tdd refactor