Added more debugging. Split code into seperate classes. Not holding a strong reference to the fragment.