added servlet, refactoring