refactoring / testing