servlet code cleanup, improved documentation