Removing $window reference