Changed the order of constructor function.