added factory to class