Remove debugging form javaScript code
Remove debugging form javaScript code and refactor code