AbstractFactory pattern implementation.