diff --git a/src/main.rs b/src/main.rs
index 299e502f165f979eaed99befcd080a8bc50d8833..1bd17254117dc4c20f4f1dbf45fd91b54af36052 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,37 +1,16 @@
 mod app_state;
+mod service;
 mod static_files;
+mod testing;
 mod tls_config;
 mod website;
-use actix_web::{get, App, HttpResponse, HttpServer, Responder};
+use actix_web::{App, HttpServer};
 use actix_web_lab::middleware::RedirectHttps;
 use app_state::AppState;
 use static_files::StaticFilesManager;
-use std::path::PathBuf;
 use tls_config::tls_config;
 use website::WebSite;
 
-#[get("/{pth:.*}")]
-async fn page(
-    website: actix_web::web::Data<WebSite>,
-    pth: actix_web::web::Path<PathBuf>,
-) -> impl Responder {
-    let pth = pth.into_inner();
-    match website.get_page_by_url(&pth) {
-        Some(page) => HttpResponse::Ok().body(page.html_doc.to_string()),
-        None => HttpResponse::NotFound().body(format!("Not found {}", pth.display())),
-    }
-}
-
-#[get("/admin/dashboard")]
-async fn admin_dashboard() -> impl Responder {
-    HttpResponse::Ok().body("Admin")
-}
-
-#[get("/admin/login")]
-async fn admin_login() -> impl Responder {
-    HttpResponse::Ok().body("Login")
-}
-
 #[actix_web::main]
 async fn main() -> std::io::Result<()> {
     let app_state = AppState::new();
@@ -43,7 +22,7 @@ async fn main() -> std::io::Result<()> {
 
     let website = WebSite::load(&app_state.config);
     let mut static_files_manager = StaticFilesManager::new(&app_state).unwrap();
-    static_files_manager.build_index().unwrap();
+    static_files_manager.build_index();
 
     let host = app_state.config.host.clone();
     let port = app_state.config.port;
@@ -64,9 +43,7 @@ async fn main() -> std::io::Result<()> {
             .app_data(actix_web::web::Data::clone(&app_state))
             .app_data(actix_web::web::Data::clone(&static_files_manager))
             .app_data(actix_web::web::Data::new(website.clone()))
-            .service(admin_dashboard)
-            .service(admin_login)
-            .service(page)
+            .service(service::page)
     })
     .bind(format!("{}:{}", host, port))?
     .bind_rustls(format!("{}:{}", host, port_tls), srv_conf)?
diff --git a/src/service.rs b/src/service.rs
new file mode 100644
index 0000000000000000000000000000000000000000..f5f67f8cfe1c46654785127e661a3e00c05afaab
--- /dev/null
+++ b/src/service.rs
@@ -0,0 +1,2 @@
+mod page;
+pub use page::*;
diff --git a/src/service/page.rs b/src/service/page.rs
new file mode 100644
index 0000000000000000000000000000000000000000..197a50ebb9364cc2224202577002b0fb85155211
--- /dev/null
+++ b/src/service/page.rs
@@ -0,0 +1,12 @@
+use crate::WebSite;
+use actix_web::{get, web, HttpResponse, Responder};
+use std::path::PathBuf;
+
+#[get("/{pth:.*}")]
+pub async fn page(website: web::Data<WebSite>, pth: web::Path<PathBuf>) -> impl Responder {
+    let pth = pth.into_inner();
+    match website.get_page_by_url(&pth) {
+        Some(page) => HttpResponse::Ok().body(page.html_doc.to_string()),
+        None => HttpResponse::NotFound().body(format!("Not found {}", pth.display())),
+    }
+}
diff --git a/src/static_files.rs b/src/static_files.rs
index f8eb2fc57a59bfcae06264f519746d877d46678b..c4fbab6dd5d9e12d2babda955b05a58ffddd794d 100644
--- a/src/static_files.rs
+++ b/src/static_files.rs
@@ -1,5 +1,5 @@
 use crate::app_state::AppState;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
 
 pub struct StaticFilesManager {
     dir: PathBuf,
@@ -7,6 +7,16 @@ pub struct StaticFilesManager {
 }
 
 impl StaticFilesManager {
+    pub fn new(app_state: &AppState) -> Result<Self, String> {
+        match Self::create_dir_if_missing(&app_state.config.storage_dir) {
+            Ok(dir) => Ok(StaticFilesManager {
+                index: Vec::new(),
+                dir,
+            }),
+            Err(msg) => Err(msg),
+        }
+    }
+
     fn create_dir_if_missing(app_dir: &PathBuf) -> Result<PathBuf, String> {
         let static_dir = app_dir.join("static");
 
@@ -44,18 +54,26 @@ impl StaticFilesManager {
         }
     }
 
-    pub fn new(app_state: &AppState) -> Result<Self, String> {
-        match Self::create_dir_if_missing(&app_state.config.storage_dir) {
-            Ok(dir) => Ok(StaticFilesManager {
-                index: Vec::new(),
-                dir,
-            }),
-            Err(msg) => Err(msg),
+    fn rec_read_dir(&mut self, root: &Path, strip_from: &Path) {
+        for entry in root.read_dir().unwrap() {
+            if let Ok(entry) = entry {
+                if entry.path().is_dir() {
+                    self.rec_read_dir(&entry.path(), strip_from);
+                } else {
+                    self._push_path(&entry.path(), strip_from);
+                }
+            }
         }
     }
 
-    pub fn build_index(&mut self) -> Result<(), String> {
-        self.index.push("TODO".to_string());
-        Ok(())
+    fn _push_path(&mut self, path: &Path, strip_from: &Path) {
+        let push_path = path.strip_prefix(strip_from).unwrap();
+        self.index
+            .push(format!("/{}", push_path.to_str().unwrap().to_owned()));
+    }
+
+    pub fn build_index(&mut self) {
+        self.index = Vec::new();
+        self.rec_read_dir(&self.dir.clone(), &self.dir.clone());
     }
 }
diff --git a/src/testing.rs b/src/testing.rs
new file mode 100644
index 0000000000000000000000000000000000000000..dec579bd8b59430ca3b65b51dcd7f0f38b8adb35
--- /dev/null
+++ b/src/testing.rs
@@ -0,0 +1,34 @@
+#[cfg(test)]
+pub const TEST_JSON_WEBSITE: &'static str = "
+{
+    \"page_data\": {
+        \"title\": \"Test Website\",
+        \"slug\": \"\",
+        \"lang\": \"en\",
+        \"description\": \"A test website\",
+        \"html_body\": \"<h1>Test Website</h1>\"
+    },
+    \"sub_pages\": [
+        {
+            \"page_data\": {
+                \"title\": \"A sub page\",
+                \"slug\": \"subpage\",
+                \"lang\": \"en\",
+                \"description\": \"A sub page of the testing web site\",
+                \"html_body\": \"<h1>A sub page</h1>\"
+            },
+            \"sub_pages\": [
+                {
+                    \"page_data\": {
+                        \"title\": \"Nested page\",
+                        \"lang\": \"en\",
+                        \"slug\": \"nested\",
+                        \"description\": \"Nested testing page\",
+                        \"html_body\": \"<h1>Nested page</h1>\"
+                    } 
+                }
+            ]
+        }
+    ]
+}
+";
diff --git a/src/website.rs b/src/website.rs
index 5d0b95c91dc1d1c327dc1a8fd1cb845be1502d43..c65d5c57cc5002b4c474cb079be4bb3b369ddf00 100644
--- a/src/website.rs
+++ b/src/website.rs
@@ -140,43 +140,11 @@ impl WebSite {
 #[cfg(test)]
 mod test_website {
     use super::*;
-    const JSON_TEMPLATE: &'static str = "
-{
-    \"page_data\": {
-        \"title\": \"Test Website\",
-        \"slug\": \"\",
-        \"lang\": \"en\",
-        \"description\": \"A test website\",
-        \"html_body\": \"<h1>Test Website</h1>\"
-    },
-    \"sub_pages\": [
-        {
-            \"page_data\": {
-                \"title\": \"A sub page\",
-                \"slug\": \"subpage\",
-                \"lang\": \"en\",
-                \"description\": \"A sub page of the testing web site\",
-                \"html_body\": \"<h1>A sub page</h1>\"
-            },
-            \"sub_pages\": [
-                {
-                    \"page_data\": {
-                        \"title\": \"Nested page\",
-                        \"lang\": \"en\",
-                        \"slug\": \"nested\",
-                        \"description\": \"Nested testing page\",
-                        \"html_body\": \"<h1>Nested page</h1>\"
-                    } 
-                }
-            ]
-        }
-    ]
-}
-        ";
+    use crate::testing::TEST_JSON_WEBSITE;
 
     #[test]
     fn test_index_pages_by_slug() {
-        let website = WebSite::from_json_str(JSON_TEMPLATE);
+        let website = WebSite::from_json_str(TEST_JSON_WEBSITE);
         let root_page = website.get_page_by_url(&PathBuf::from("/"));
         assert!(root_page.is_some());
         let root_page = root_page.unwrap();