Slightly untangled some old JavaScript for prepared and published calls