Three killed in factory fire