refactoring ... + tests
refactoring ... + tests