Well, both Button and Panel does that without any xul module stuff. It's basically moving this code to a different module, and them exports some agnostic methods. It's just plain MVC / MVP, nothing more. Take a look to panel.js, if you still have some doubt about how to implement that, we can maybe schedule a 1:1 to figure it out.