refactor to avoid scale flashes