test and refactoring