add new method for ifelsefactory