Added factory definition