refact code on AbsModel