Refactor rescaling process