refact: move append or update service instance logic to another function
refact: move append or update service instance logic to another function

Signed-off-by: Wilson Júnior <507ef67474883645328da05edc8e5a3b7bb7b743@gmail.com>

gwmoura/tsuru,guilhermebr/tsuru,tsuru/tsuru,tsuru/tsuru,cezarsa/tsuru,ArxdSilva/tsuru,ArxdSilva/tsuru,tsuru/tsuru,gwmoura/tsuru,ggarnier/tsuru,guilhermebr/tsuru,ArxdSilva/tsuru,guilhermebr/tsuru,ggarnier/tsuru,tsuru/tsuru,ggarnier/tsuru,guilhermebr/tsuru,ggarnier/tsuru,cezarsa/tsuru,cezarsa/tsuru,gwmoura/tsuru,cezarsa/tsuru,ArxdSilva/tsuru