switching to class structure