Index: src/main/java/com/wediscussmovies/project/LoggedUser.java
===================================================================
--- src/main/java/com/wediscussmovies/project/LoggedUser.java	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/java/com/wediscussmovies/project/LoggedUser.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -18,3 +18,4 @@
         return null;
     }
+
 }
Index: src/main/java/com/wediscussmovies/project/model/Movie.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -40,5 +40,5 @@
     @OneToMany(mappedBy = "movie", fetch = FetchType.LAZY)
     private Collection<MovieActors> actors;
-    @OneToMany(mappedBy = "movie")
+    @OneToMany(mappedBy = "movie", fetch = FetchType.LAZY)
     private Collection<MovieGenres> genres;
     @OneToMany(mappedBy = "movie")
Index: src/main/java/com/wediscussmovies/project/web/DesignFrontMovies.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/DesignFrontMovies.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
+++ src/main/java/com/wediscussmovies/project/web/DesignFrontMovies.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -0,0 +1,17 @@
+package com.wediscussmovies.project.web;
+
+import com.wediscussmovies.project.model.Movie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DesignFrontMovies {
+    public static  void designMovieList(List<Movie> movieList, List<List<Movie>> movie_rows){
+        for(int i=0; i<movieList.size(); i+=4){
+            int j = i+4;
+            if(j>movieList.size())
+                j= movieList.size();
+            movie_rows.add(movieList.subList(i, j));
+        }
+    }
+}
Index: src/main/java/com/wediscussmovies/project/web/controller/MovieController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/MovieController.java	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/java/com/wediscussmovies/project/web/controller/MovieController.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -8,4 +8,5 @@
 import com.wediscussmovies.project.service.MovieService;
 import com.wediscussmovies.project.service.PersonService;
+import com.wediscussmovies.project.web.DesignFrontMovies;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -47,20 +48,8 @@
         }
 
-        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
+        addModelPropertiesForUser(model);
 
-        if (!(auth instanceof AnonymousAuthenticationToken)){
-            UserDetails userDetails = (UserDetails) auth.getPrincipal();
-            User user = (User) userDetails;
-          model.addAttribute("likedMovies",this.movieService.findLikedMoviesByUser(user));
-          model.addAttribute("user",user);
-        }
-        List<Movie> movieList = movies;
         List<List<Movie>> movie_rows = new ArrayList<>();
-        for(int i=0; i<movieList.size(); i+=4){
-            int j = i+4;
-            if(j>movieList.size())
-                j=movieList.size();
-            movie_rows.add(movieList.subList(i, j));
-        }
+        DesignFrontMovies.designMovieList(movies,movie_rows);
         model.addAttribute("movies", movies);
         model.addAttribute("movie_rows", movie_rows);
@@ -74,13 +63,5 @@
     public String getMovie(@PathVariable Integer id, Model model){
         model.addAttribute("movie", movieService.findById(id));
-
-        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
-        if (!(auth instanceof AnonymousAuthenticationToken)){
-            UserDetails userDetails = (UserDetails) auth.getPrincipal();
-            User user = (User) userDetails;
-            model.addAttribute("likedMovies",this.movieService.findLikedMoviesByUser(user));
-            model.addAttribute("user",user);
-        }
-
+        addModelPropertiesForUser(model);
         model.addAttribute("contentTemplate", "movieShow");
         return "template";
@@ -184,3 +165,9 @@
         model.addAttribute("genres", genreService.findAll());
     }
+    private void addModelPropertiesForUser(Model model){
+        User user = LoggedUser.getLoggedUser();
+        model.addAttribute("likedMovies",this.movieService.findLikedMoviesByUser(user));
+        model.addAttribute("user",user);
+        }
+
 }
Index: src/main/java/com/wediscussmovies/project/web/controller/UsersController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/UsersController.java	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/java/com/wediscussmovies/project/web/controller/UsersController.java	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -8,4 +8,5 @@
 import com.wediscussmovies.project.service.MovieService;
 import com.wediscussmovies.project.service.UserService;
+import com.wediscussmovies.project.web.DesignFrontMovies;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -65,10 +66,5 @@
         List<Movie> movieList = this.movieService.findLikedMoviesByUser(LoggedUser.getLoggedUser());
         List<List<Movie>> movie_rows = new ArrayList<>();
-        for(int i=0; i<movieList.size(); i+=4){
-            int j = i+4;
-            if(j>movieList.size())
-                j= movieList.size();
-            movie_rows.add(movieList.subList(i, j));
-        }
+        DesignFrontMovies.designMovieList(movieList,movie_rows);
         model.addAttribute("movie_rows", movie_rows);
         model.addAttribute("contentTemplate","favoriteList");
Index: src/main/resources/static/js/sharedScript.js
===================================================================
--- src/main/resources/static/js/sharedScript.js	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/resources/static/js/sharedScript.js	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -39,7 +39,9 @@
     $(".search-button-title").on("click",function (){
         let filter = $("#searchTitle").val()
+        console.log(elements)
         for (let item of elements){
-            let title = item.cells[0].innerText
+            let title =  $(item).find(".card-title").text()
             if (title.toLowerCase() === filter.toLowerCase()){
+                console.log("Da")
                 $(item).css("display","block")
             }
@@ -54,9 +56,11 @@
    $(".search-button").on("click",function () {
         let filter = $("#searchGenre").val()
-        for (let item of elements) {
-            let genre = item.cells[4].children;
+       console.log(elements)
+
+       for (let item of elements) {
+            let genre = $(item).find(".card-genre")
             let visible = false;
 
-            for (g of genre) {
+            for (let g of genre) {
 
                 if ($(g).text().toLowerCase() === filter.toLowerCase()) {
Index: src/main/resources/templates/moviesList.html
===================================================================
--- src/main/resources/templates/moviesList.html	(revision 2efe93e6443168a68d51579962ac90a4d618179b)
+++ src/main/resources/templates/moviesList.html	(revision 7f3655122036717700124fc482399ad0780bdf52)
@@ -12,8 +12,10 @@
     <div class="container mb-4">
         <div class="row" th:each="row: ${movie_rows}" >
-            <div class="col-md-3" th:each="movie: ${row}" >
+            <div class="col-md-3 elements" th:each="movie: ${row}" >
                     <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
                         <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
                         <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
+                            <span th:each="genre: ${movie.getGenres()}"  th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span>
+
                         </a>
                         <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
