js code cleanup

Added a little JavaScript code cleanup