Refactoring of javascript that make the servlet call to initiate the monitor