struct returns class instead of constructor function