Added factory methods/improved API compatibility.