improve code of Product and Document services.