During what event was Legalism abolished?