some clean ups and fixes