Wrap bool setting casting in a method