Restructure to class