Remove dependencies on MainActivity.