Probably should grab the application instance and store it at the beginning of the method as it's used all throughout this method:

`var instance = global.instances[ namespace ];`