Improved automatic scaling