using refs to reference DOM element, but kinda wonky, having to use var that = this repeatedly