Refactoring Invoke and render code to isolate all servlet api dependencies