Refactor sidebar code so we are not creating static DOM elements in JS.