Use define_method instead of class_eval where sensible