refactor in test