class_eval doesn't work in production, use define_method