removed bootstrap from servlet and improved logic