Refactor WebView callback setups.