refactor checking for share availability