Updated to use classes