Some cleanup on factory methods.