Make it work with any data structure responding to to_h