Changed the order of object creation.