refactored js that was previously inserting inline JS to instead use class to hide