Cleanup: factor getInvocationCodeFromJson a little bit.