factory test - refactored