Refactor event binding to make it easier to bind/unbind components