refactor controller and service (session apper too mach but it will be modified later)