Cleanup: continue work on getCastCodeFromJson.