> best put inside the class? (Not super-sure about the latter)

Probably yes, but your call.