fixed large bug by refactoring out a method for building DOM so that event listeners aren't created multiple times.