rework to not use class_eval