shadow refactor