Refactor for servlet engine