Added factory pattern example