Refactored abstract factory