refactored strategy factory