Return class inside of closure with window.object