Small code refactor - creating smaller functions + renamed some variables. Also added body click event callback to close comments section when appropriate.