Refactored shadow code into ShadowManipulator