created separate controller and service files