that's the way to do it
That method is correct.