Switch to factory pattern.