some updated to use newer APIs