Refactored ShadowServer implementation