Use Class definition instead of function-based object approach