Refactoring persistent servlet engine