refactor code and add service_uri