Removes the usage of the ViewTreeObserver class