modify factory and use parameter defaults to reduce loc