updated character factory pattern