Index: src/main/java/it/finki/tinki/web/controller/LoginController.java
===================================================================
--- src/main/java/it/finki/tinki/web/controller/LoginController.java	(revision 4b1c93d9aae301f7d143f9950c8baf7d3cbf22b7)
+++ src/main/java/it/finki/tinki/web/controller/LoginController.java	(revision 277b400d96cacb99d0e8f7e778f84f24f86e0cdc)
@@ -34,5 +34,5 @@
 
     @PostMapping(path = "/login")
-    public LoginResponseDTO testPage(@RequestBody AccountLoginDTO body) throws ResponseStatusException {
+    public LoginResponseDTO loginProcess(@RequestBody AccountLoginDTO body) throws ResponseStatusException {
 
         Account a1 = accountService.findUser(body.getEmail(), body.getPassword(), body.getType());
@@ -40,94 +40,9 @@
         if(a1!=null){
             if(a1.getClass().equals(User.class)){
-
-                UserResponseDTO uDto = new UserResponseDTO();
-
-                uDto.setError(null);
-
-                uDto.setId(a1.getId());
-                uDto.setEmail(a1.getEmail());
-                uDto.setName(a1.getName());
-                uDto.setType(AccountType.USER);
-                uDto.setSurname(((User) a1).getSurname());
-
-                uDto.setRetained(((User) a1).getRetainedSkills());
-                uDto.setToLearn(((User) a1).getSkillsToLearn());
-
-                List<Job> matchedJobs = this.matchmakerService.getMatchingJobsForUser((User) a1);
-                List<Project> matchedProjects = this.matchmakerService.getMatchingProjectsForUser((User) a1);
-                List<Internship> matchedInternships = this.matchmakerService.getMatchingInternshipsForUser((User) a1);
-
-                matchedJobs.forEach(job -> {
-                    JobResponseDTO dto = new JobResponseDTO(job);
-                    uDto.getJobs().add(dto);
-                });
-
-                matchedProjects.forEach(project -> {
-                    ProjectResponseDTO dto = new ProjectResponseDTO(project);
-                    uDto.getProjects().add(dto);
-                });
-
-                matchedInternships.forEach(internship -> {
-                    InternshipResponseDTO dto = new InternshipResponseDTO(internship);
-                    uDto.getInternships().add(dto);
-                });
-
-
-                return uDto;
-
+                return processUser(a1);
             }else if(a1.getClass().equals(Team.class)){
-
-                TeamResponseDTO tDto = new TeamResponseDTO();
-
-                tDto.setError(null);
-
-                tDto.setId(a1.getId());
-                tDto.setEmail(a1.getEmail());
-                tDto.setName(a1.getName());
-                tDto.setType(AccountType.TEAM);
-                tDto.setMembers(((Team) a1).getMembers());
-
-                List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId());
-                List<Project> projects = this.workService.getAllProjectsByAccount(a1.getId());
-
-                jobs.forEach(job -> {
-                    JobResponseDTO dto = new JobResponseDTO(job);
-                    tDto.getJobs().add(dto);
-                });
-
-                projects.forEach(project -> {
-                    ProjectResponseDTO dto = new ProjectResponseDTO(project);
-                    tDto.getProjects().add(dto);
-                });
-
-                return tDto;
-
+                return processTeam(a1);
             }else{
-
-                CompanyResponseDTO cDto = new CompanyResponseDTO();
-
-                cDto.setError(null);
-
-                cDto.setId(a1.getId());
-                cDto.setEmail(a1.getEmail());
-                cDto.setName(a1.getName());
-                cDto.setType(AccountType.COMPANY);
-                cDto.setAddress(((Company) a1).getAddress());
-
-                List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId());
-                List<Internship> internships = this.workService.getAllInternshipsByAccount(a1.getId());
-
-                jobs.forEach(job -> {
-                    JobResponseDTO dto = new JobResponseDTO(job);
-                    cDto.getJobs().add(dto);
-                });
-
-                internships.forEach(internship -> {
-                    InternshipResponseDTO dto = new InternshipResponseDTO(internship);
-                    cDto.getInternships().add(dto);
-                });
-
-                return cDto;
-
+                return processCompany(a1);
             }
         }
@@ -136,3 +51,94 @@
     }
 
+    private UserResponseDTO processUser(Account a1){
+        UserResponseDTO uDto = new UserResponseDTO();
+
+        uDto.setError(null);
+
+        uDto.setId(a1.getId());
+        uDto.setEmail(a1.getEmail());
+        uDto.setName(a1.getName());
+        uDto.setType(AccountType.USER);
+        uDto.setSurname(((User) a1).getSurname());
+
+        uDto.setRetained(((User) a1).getRetainedSkills());
+        uDto.setToLearn(((User) a1).getSkillsToLearn());
+
+        List<Job> matchedJobs = this.matchmakerService.getMatchingJobsForUser((User) a1);
+        List<Project> matchedProjects = this.matchmakerService.getMatchingProjectsForUser((User) a1);
+        List<Internship> matchedInternships = this.matchmakerService.getMatchingInternshipsForUser((User) a1);
+
+        matchedJobs.forEach(job -> {
+            JobResponseDTO dto = new JobResponseDTO(job);
+            uDto.getJobs().add(dto);
+        });
+
+        matchedProjects.forEach(project -> {
+            ProjectResponseDTO dto = new ProjectResponseDTO(project);
+            uDto.getProjects().add(dto);
+        });
+
+        matchedInternships.forEach(internship -> {
+            InternshipResponseDTO dto = new InternshipResponseDTO(internship);
+            uDto.getInternships().add(dto);
+        });
+
+
+        return uDto;
+    }
+
+    private TeamResponseDTO processTeam(Account a1){
+        TeamResponseDTO tDto = new TeamResponseDTO();
+
+        tDto.setError(null);
+
+        tDto.setId(a1.getId());
+        tDto.setEmail(a1.getEmail());
+        tDto.setName(a1.getName());
+        tDto.setType(AccountType.TEAM);
+        tDto.setMembers(((Team) a1).getMembers());
+
+        List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId());
+        List<Project> projects = this.workService.getAllProjectsByAccount(a1.getId());
+
+        jobs.forEach(job -> {
+            JobResponseDTO dto = new JobResponseDTO(job);
+            tDto.getJobs().add(dto);
+        });
+
+        projects.forEach(project -> {
+            ProjectResponseDTO dto = new ProjectResponseDTO(project);
+            tDto.getProjects().add(dto);
+        });
+
+        return tDto;
+    }
+
+    private CompanyResponseDTO processCompany(Account a1){
+        CompanyResponseDTO cDto = new CompanyResponseDTO();
+
+        cDto.setError(null);
+
+        cDto.setId(a1.getId());
+        cDto.setEmail(a1.getEmail());
+        cDto.setName(a1.getName());
+        cDto.setType(AccountType.COMPANY);
+        cDto.setAddress(((Company) a1).getAddress());
+
+        List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId());
+        List<Internship> internships = this.workService.getAllInternshipsByAccount(a1.getId());
+
+        jobs.forEach(job -> {
+            JobResponseDTO dto = new JobResponseDTO(job);
+            cDto.getJobs().add(dto);
+        });
+
+        internships.forEach(internship -> {
+            InternshipResponseDTO dto = new InternshipResponseDTO(internship);
+            cDto.getInternships().add(dto);
+        });
+
+        return cDto;
+    }
+
 }
