use class_eval to remove unnecessary logics.