If you extract all of this in an external object, then it's probably better to call its init from MessageManager's init or even in startup.js.