Change logic according to new model