Refactoring scale calculation