implement sdk addon logic (as test for issue 5600) and tidy