Refactored the scaling extension