extract method in test file