clean up scaling logic