Code cleanup to batch ops js