extract the part about scaling to a new class
new class to manage the scaling