working on factory mode