be careful, serviceId can be `0`, that's why I used `=== undefined` or `== null` in most places