Remove redundant code in shiny.js