Refactoring for servlet engine