refactor the start_route_service function, group specific codes to a procedure