case branch should be extracted to a method