Refactored to Factory