Refactor use of shadow.