Refactored more servlets and added comments for a better understanding.