improve case branch by class