Replaced public constructors with factory methods where appropriate.