diff --git a/client/src/index.tsx b/client/src/index.tsx
index c8885ad..7902c9b 100644
--- a/client/src/index.tsx
+++ b/client/src/index.tsx
@@ -24,21 +24,13 @@
 import { StrictMode } from 'react';
 import { createRoot } from 'react-dom/client';
 import { Provider } from 'react-redux';
-import { createBrowserRouter, createRoutesFromElements, Outlet, Route, RouterProvider } from 'react-router-dom';
+import { RouterProvider } from 'react-router-dom';
 import socketio from 'socket.io-client';
 
-import App from './App';
-import ContactList from './components/ContactList';
-import AuthProvider from './contexts/AuthProvider';
 import { SocketProvider } from './contexts/Socket';
-import WebSocketProvider from './contexts/WebSocketProvider';
-import AccountSettings from './pages/AccountSettings';
-import JamiMessenger from './pages/JamiMessenger';
-import ServerSetup from './pages/ServerSetup';
-import Welcome from './pages/Welcome';
 import { store } from './redux/store';
+import { router } from './router';
 import defaultTheme from './themes/Default';
-import { ThemeDemonstrator } from './themes/ThemeDemonstrator';
 
 const queryClient = new QueryClient({
   defaultOptions: {
@@ -50,29 +42,6 @@
 
 const socket = socketio();
 
-const router = createBrowserRouter(
-  createRoutesFromElements(
-    <Route path="/" element={<App />}>
-      <Route index element={<Welcome />} />
-      <Route path="theme" element={<ThemeDemonstrator />} />
-      <Route
-        element={
-          <AuthProvider>
-            <WebSocketProvider>
-              <Outlet />
-            </WebSocketProvider>
-          </AuthProvider>
-        }
-      >
-        <Route path="account/*" element={<JamiMessenger />} />
-        <Route path="settings" element={<AccountSettings />} />
-        <Route path="contacts" element={<ContactList />} />
-      </Route>
-      <Route path="setup" element={<ServerSetup />} />
-    </Route>
-  )
-);
-
 const container = document.getElementById('root');
 if (!container) {
   throw new Error('Failed to get the root element');
