Made changes in the factory methods