added servlet test, refactored