refactoring
start with tests