added factory definition