added factory patern