Factory method to create Objects