diff --git a/ui/src/Pages/InitialSetupPage.js b/ui/src/Pages/LoginPage/InitialSetupPage.js
similarity index 97%
rename from ui/src/Pages/InitialSetupPage.js
rename to ui/src/Pages/LoginPage/InitialSetupPage.js
index ac609c4..fcea710 100644
--- a/ui/src/Pages/InitialSetupPage.js
+++ b/ui/src/Pages/LoginPage/InitialSetupPage.js
@@ -3,7 +3,8 @@ import gql from 'graphql-tag'
 import { Mutation, Query } from 'react-apollo'
 import { Redirect } from 'react-router-dom'
 import { Button, Form, Message, Container, Header } from 'semantic-ui-react'
-import { login, checkInitialSetupQuery } from './LoginPage'
+
+import { checkInitialSetupQuery, login } from './loginUtilFunctions'
 
 const initialSetupMutation = gql`
   mutation InitialSetup(
diff --git a/ui/src/Pages/LoginPage.js b/ui/src/Pages/LoginPage/LoginPage.js
similarity index 85%
rename from ui/src/Pages/LoginPage.js
rename to ui/src/Pages/LoginPage/LoginPage.js
index b2fdd14..540d729 100644
--- a/ui/src/Pages/LoginPage.js
+++ b/ui/src/Pages/LoginPage/LoginPage.js
@@ -3,6 +3,7 @@ import gql from 'graphql-tag'
 import { Mutation, Query } from 'react-apollo'
 import { Redirect } from 'react-router-dom'
 import { Button, Form, Message, Container, Header } from 'semantic-ui-react'
+import { checkInitialSetupQuery, login } from './loginUtilFunctions'
 
 const authorizeMutation = gql`
   mutation Authorize($username: String!, $password: String!) {
@@ -14,27 +15,6 @@ const authorizeMutation = gql`
   }
 `
 
-export const checkInitialSetupQuery = gql`
-  query CheckInitialSetup {
-    siteInfo {
-      initialSetup
-    }
-  }
-`
-
-function setCookie(cname, cvalue, exdays) {
-  var d = new Date()
-  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000)
-  var expires = 'expires=' + d.toUTCString()
-  document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/'
-}
-
-export function login(token) {
-  localStorage.setItem('token', token)
-  setCookie('token', token, 360)
-  window.location = '/'
-}
-
 class LoginPage extends Component {
   constructor(props) {
     super(props)
diff --git a/ui/src/Pages/LoginPage/loginUtilFunctions.js b/ui/src/Pages/LoginPage/loginUtilFunctions.js
new file mode 100644
index 0000000..842a8b2
--- /dev/null
+++ b/ui/src/Pages/LoginPage/loginUtilFunctions.js
@@ -0,0 +1,22 @@
+import gql from 'graphql-tag'
+
+export const checkInitialSetupQuery = gql`
+  query CheckInitialSetup {
+    siteInfo {
+      initialSetup
+    }
+  }
+`
+
+export function setCookie(cname, cvalue, exdays) {
+  var d = new Date()
+  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000)
+  var expires = 'expires=' + d.toUTCString()
+  document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/'
+}
+
+export function login(token) {
+  localStorage.setItem('token', token)
+  setCookie('token', token, 360)
+  window.location = '/'
+}
diff --git a/ui/src/Routes.js b/ui/src/Routes.js
index ec96fa9..108552d 100644
--- a/ui/src/Routes.js
+++ b/ui/src/Routes.js
@@ -1,25 +1,32 @@
-import React, { Component } from 'react'
+import React from 'react'
 import { Route, Switch, Redirect } from 'react-router-dom'
 
-import LoginPage from './Pages/LoginPage'
-import AlbumsPage from './Pages/AllAlbumsPage/AlbumsPage'
-import AlbumPage from './Pages/AlbumPage/AlbumPage'
-import AuthorizedRoute from './AuthorizedRoute'
-import PhotosPage from './Pages/PhotosPage/PhotosPage'
-import InitialSetupPage from './Pages/InitialSetupPage'
+import { Loader } from 'semantic-ui-react'
 
-class Routes extends Component {
+const AlbumsPage = React.lazy(() => import('./Pages/AllAlbumsPage/AlbumsPage'))
+const AlbumPage = React.lazy(() => import('./Pages/AlbumPage/AlbumPage'))
+const AuthorizedRoute = React.lazy(() => import('./AuthorizedRoute'))
+const PhotosPage = React.lazy(() => import('./Pages/PhotosPage/PhotosPage'))
+
+const LoginPage = React.lazy(() => import('./Pages/LoginPage/LoginPage'))
+const InitialSetupPage = React.lazy(() =>
+  import('./Pages/LoginPage/InitialSetupPage')
+)
+
+class Routes extends React.Component {
   render() {
     return (
-      <Switch>
-        <Route path="/login" component={LoginPage} />
-        <Route path="/initialSetup" component={InitialSetupPage} />
-        <AuthorizedRoute exact path="/albums" component={AlbumsPage} />
-        <AuthorizedRoute path="/album/:id" component={AlbumPage} />
-        <AuthorizedRoute path="/photos" component={PhotosPage} />
-        <Route path="/" exact render={() => <Redirect to="photos" />} />
-        <Route render={() => <div>Page not found</div>} />
-      </Switch>
+      <React.Suspense fallback={<Loader active>Loading page</Loader>}>
+        <Switch>
+          <Route path="/login" component={LoginPage} />
+          <Route path="/initialSetup" component={InitialSetupPage} />
+          <AuthorizedRoute exact path="/albums" component={AlbumsPage} />
+          <AuthorizedRoute path="/album/:id" component={AlbumPage} />
+          <AuthorizedRoute path="/photos" component={PhotosPage} />
+          <Route path="/" exact render={() => <Redirect to="photos" />} />
+          <Route render={() => <div>Page not found</div>} />
+        </Switch>
+      </React.Suspense>
     )
   }
 }
