Refacor for servlet engine