Moved fields to class instead of constructor