refactor batch ops