refactored part of tests