Digitizing factories to improve productivity