refactor scale example