max_class_size a bit ugly but working