I think what you did in your code is fine.